
package com.chengyu.eyc.config;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ModelAttribute;

@ControllerAdvice
public class GlobalModelAttributeConfig {

    @Value("${eyc.version:1}")
    private String version;

    @ModelAttribute(value = "systemDate")
    public long getSystemData() {
        return System.currentTimeMillis();
    }

    @ModelAttribute(value = "version")
    public String getVersion(HttpServletRequest request) {
        return version;
    }

}
